home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / exec.zip / SHELL.LST < prev   
File List  |  1988-09-12  |  7KB  |  192 lines

  1. Microsoft (R) Macro Assembler Version 5.00                  9/12/88 00:30:16
  2.                                                              Page     1-1
  3.  
  4.  
  5.                 ; Date: Tue, 16 Aug 88 18:11 PDT 
  6.                 ; From: <MULTI%TRIUMFCL.BITNET@CORNELLC.CCS.COR
  7.                 NELL.EDU> 
  8.                 ; Subject: Correction to previous version... 
  9.                  
  10.                 ;MASM SHELL; 
  11.                 ;LINK SHELL; 
  12.                 ;EXE2BIN SHELL SHELL.COM; 
  13.                 ; 
  14.                 ; Modifications: 
  15.                 ; 
  16.                 ;       Who             When            What 
  17.                 ;       ===             ====            ==== 
  18.                 ;       Y.N. Miles      15-Aug-88       Tried t
  19.                 o figure out EXEC (SHELL) 
  20.                 ;                                       from th
  21.                 e IBM tech. ref. manual 
  22.                 ;                                       Gave up
  23.                  in disgust, wrote my own 
  24.                 ; 
  25.                 ;       Y.N. Miles      16-Aug-88       Char co
  26.                 unt in COMAND does not 
  27.                 ;                                       include
  28.                  itself or trailing <CR> 
  29.                 ;                                       Specify
  30.                  path for COMMAND.COM 
  31.                 ;                                       Correct
  32.                  docs for 64K space req. 
  33.                 ; 
  34.                 ;NOTE:  This program is in .COM form because I 
  35.                 cannot stand .EXE files 
  36.                 ; 
  37.  0000                code    segment 
  38.                 assume  cs:code,ds:code,es:code 
  39.  0100                        org     100h 
  40.  0100  89 26 019C R        start:  mov     spsave,sp       ; Save SP point
  41.                 er 
  42.  0104  8C 16 019A R                mov     sssave,ss       ; Save SS block
  43.                  
  44.                 ; 
  45.  0108  BB 1000                    mov     bx,1000h        ;  ...surrender
  46.                  64K of space 
  47.  010B  B4 4A                    mov     ah,4ah          ;  ...with this
  48.                  call 
  49.  010D  CD 21                    int     21h             ;  ...for sub-p
  50.                 rocess area 
  51.                 ; 
  52.  010F  B8 005C                    mov     ax,5Ch          ; Get input def
  53.                 ault FCB 
  54.  0112  A3 0192 R                mov     fcbin+0,ax      ;  ...and save 
  55.                 offset 
  56.  0115  8C 06 0194 R                mov     fcbin+2,es      ;  ...with segm
  57.                 ent 
  58.                 ; 
  59. Microsoft (R) Macro Assembler Version 5.00                  9/12/88 00:30:16
  60.                                                              Page     1-2
  61.  
  62.  
  63.  0119  8D 36 0081                lea     si,cs:81h       ; Get input def
  64.                 ault FCB 
  65.  011D  8D 3E 005C                lea     di,es:5Ch       ;  ...kosher it
  66.                  
  67.  0121  B8 2901                    mov     ax,2901h        ;  ...by fillin
  68.                 g it 
  69.  0124  CD 21                    int     21h             ;  ...with blan
  70.                 ks 
  71.                 ; 
  72.  0126  B8 006C                    mov     ax,6Ch          ; Get output de
  73.                 fault FCB 
  74.  0129  A3 0196 R                mov     fcbot+0,ax      ;  ...and save 
  75.                 offset 
  76.  012C  8C 06 0198 R                mov     fcbot+2,es      ;  ...with segm
  77.                 ent 
  78.                 ; 
  79.  0130  8D 36 0081                lea     si,cs:81h       ; Get output de
  80.                 fault FCB 
  81.  0134  8D 3E 006C                lea     di,es:6Ch       ;  ...kosher it
  82.                  
  83.  0138  B8 2901                    mov     ax,2901h        ;  ...by fillin
  84.                 g it 
  85.  013B  CD 21                    int     21h             ;  ...with blan
  86.                 ks 
  87.                 ; 
  88.  013D  C7 06 018C R 0000            mov     envir,0         ; No environmen
  89.                 t segment (so static) 
  90.                 ; 
  91.  0143  C7 06 018E R 0080            mov     comand+0,80h    ;  ...setup com
  92.                 mand line for copy to 
  93.  0149  8C 06 0190 R                mov     comand+2,es     ;  ...parameter
  94.                  area 80h in PSP 
  95.                 ; 
  96.  014D  8D 36 0176 R                lea     si,order        ; Get order cou
  97.                 nt/ascii_string/<CR> 
  98.  0151  8A 0E 0176 R                mov     cl,order        ; Get bytes in 
  99.                 ASCII string 
  100.  0155  80 C1 02                    add     cl,2            ;  ...add two n
  101.                 on-string bytes 
  102.  0158  B5 00                    mov     ch,0            ;  ...convert b
  103.                 yte count to word count 
  104.  015A  8D 3E 0080                lea     di,es:80h       ;  ...copy into
  105.                  DOS parameter area at 80h 
  106.  015E  F3/ A4                    rep     movsb           ;  ...the order
  107.                  =  count/ascii_string/CR 
  108.                 ; 
  109.  0160  8D 16 017D R                lea     dx,daemon       ; DS:BX --> Dos
  110.                  transient null terminated 
  111.  0164  8D 1E 018C R                lea     bx,envir        ; ES:BX --> Sta
  112.                 rt 7 word parameter block 
  113.                 ; 
  114.  0168  B8 4B00                    mov     ax,4B00h        ; Do the DOS ex
  115.                 ec (shell) request 
  116.  016B  CD 21                    int     21h             ;  ...with call
  117. Microsoft (R) Macro Assembler Version 5.00                  9/12/88 00:30:16
  118.                                                              Page     1-3
  119.  
  120.  
  121.                  
  122.                 ; 
  123.  016D  8B 26 019C R                mov     sp,spsave       ; Restore SP 
  124.  0171  8E 16 019A R                mov     ss,sssave       ;  ...and SS 
  125.  0175  C3                    ret                     ; RET uses 0 on
  126.                  stack to int 20h in PSP 
  127.                 ; 
  128.  0176  05 2F 43 44 49 52 0D    order   db      5,"/CDIR",13            ; Count
  129.                 ed order for DOS, <CR> end 
  130.  017D  43 3A 5C 43 4F 4D 4D    daemon  db      "C:\COMMAND.COM",0      ; DOS t
  131.                 ransient executes order 
  132.        41 4E 44 2E 43 4F 4D    
  133.        00            
  134.                 ; 
  135.  018C  0000            envir   dw      0               ; Environment s
  136.                 egment (static,  not used) 
  137.  018E  0000 0000        comand  dw      0,0             ; Command line 
  138.                 dword  (points to PSP:80h) 
  139.  0192  0000 0000        fcbin   dw      0,0             ; Input FCB dwo
  140.                 rd     (points to FCB:5Ch) 
  141.  0196  0000 0000        fcbot   dw      0,0             ; Outpt FCB dwo
  142.                 rd     (points to FCB:6Ch) 
  143.                 ; 
  144.  019A  0000            sssave  dw      0               ; Supposed to s
  145.                 ave stack segment 
  146.  019C  0000            spsave  dw      0               ; and stack poi
  147.                 nter so RET calls INT 20h 
  148.                 ; 
  149.  019E                code    ends 
  150.                 ; 
  151.                 end     start 
  152. Microsoft (R) Macro Assembler Version 5.00                  9/12/88 00:30:16
  153.                                                              Symbols-1
  154.  
  155.  
  156. Segments and Groups:
  157.  
  158.                 N a m e             Length     Align    Combine Class
  159.  
  160. CODE . . . . . . . . . . . . . .      019E    PARA    NONE    
  161.  
  162. Symbols:            
  163.  
  164.                 N a m e             Type     Value     Attr
  165.  
  166. COMAND . . . . . . . . . . . . .      L WORD    018E    CODE
  167.  
  168. DAEMON . . . . . . . . . . . . .      L BYTE    017D    CODE
  169.  
  170. ENVIR  . . . . . . . . . . . . .      L WORD    018C    CODE
  171.  
  172. FCBIN  . . . . . . . . . . . . .      L WORD    0192    CODE
  173. FCBOT  . . . . . . . . . . . . .      L WORD    0196    CODE
  174.  
  175. ORDER  . . . . . . . . . . . . .      L BYTE    0176    CODE
  176.  
  177. SPSAVE . . . . . . . . . . . . .      L WORD    019C    CODE
  178. SSSAVE . . . . . . . . . . . . .      L WORD    019A    CODE
  179. START  . . . . . . . . . . . . .      L NEAR    0100    CODE
  180.  
  181. @FILENAME  . . . . . . . . . . .      TEXT  shell        
  182.  
  183.  
  184.      87 Source  Lines
  185.      87 Total   Lines
  186.      12 Symbols
  187.  
  188.   51020 + 175508 Bytes symbol space free
  189.  
  190.       0 Warning Errors
  191.       0 Severe  Errors
  192.